Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

About Shader Objects

A shader object (or, more briefly, a shader ) is a type of QuickDraw 3D object that you can use to manipulate visual effects that depend on the illumination provided by a view's group of lights, the color and other material properties (such as the reflectance and texture) of surfaces in a model, and the position and orientation of the lights and objects in a model. Shaders that affect the surfaces of geometric objects based on their material properties, position, and orientation (and other factors) are surface-based shaders. QuickDraw 3D supplies several surface-based shaders, and you can define your own custom surface-based shaders to create other special effects. For instance, you can define a custom surface-based shader to handle custom attributes you have attached to surfaces or parts of surfaces.

The application of surface-based shaders occurs within the QuickDraw 3D shading architecture, an environment in which shaders can be applied at various stages in the imaging pipeline. This architecture provides well-defined entry points at specific locations along the imaging pipeline. At each such location, you can invoke a shader. This capability allows you to create both two-dimensional and three-dimensional visual effects.

The QuickDraw 3D shading architecture is implemented using an object-based class hierarchy. For each location in the imaging pipeline at which a shader can be invoked, a subclass of the shader object has been defined. The following sections describe the available classes of shader objects.

Surface-Based Shaders

Illumination Models

Textures


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |